using System;
using System.Runtime.InteropServices;

namespace DeviceApplication1
{
    class Api
    {
        public enum TernaryRasterOperations : uint
        {
            SRCCOPY     = 0x00CC0020,
            SRCPAINT    = 0x00EE0086,
            SRCAND      = 0x008800C6,
            SRCINVERT   = 0x00660046,
            SRCERASE    = 0x00440328,
            NOTSRCCOPY  = 0x00330008,
            NOTSRCERASE = 0x001100A6,
            MERGECOPY   = 0x00C000CA,
            MERGEPAINT  = 0x00BB0226,
            PATCOPY     = 0x00F00021,
            PATPAINT    = 0x00FB0A09,
            PATINVERT   = 0x005A0049,
            DSTINVERT   = 0x00550009,
            BLACKNESS   = 0x00000042,
            WHITENESS   = 0x00FF0062,
            // solo para WinVer >= 5.0.0
            CAPTUREBLT  = 0x40000000, 
        }

        [DllImport("user32.dll")]
        public static extern IntPtr GetWindowDC (IntPtr hwnd);

        [DllImport("gdi32.dll", EntryPoint = "BitBlt", SetLastError = true)]
        [return: MarshalAs(UnmanagedType.Bool)]
        public static extern bool BitBlt(
            [In] IntPtr hdc, 
            int nXDest, 
            int nYDest, 
            int nWidth, 
            int nHeight, 
            [In] IntPtr hdcSrc, 
            int nXSrc, 
            int nYSrc, 
            TernaryRasterOperations dwRop
        );
    }
}
